<!--采购入库明细-->
<template>

    <div>

        <el-form :model="model"  ref="ruleForm" label-width="100px" class="demo-ruleForm page-form">
            <el-row>
                
                <el-col :span="8">
                    <el-form-item label="入库编号" prop="Number">
                        <el-input v-model="model.Number" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="采购状态" prop="Status">
                        <el-tag type="info" v-if="model.Status == '0'">待审核</el-tag>
                        <el-tag type="success" v-else-if="model.Status == '1'">已审核</el-tag>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="供应商" prop="VendorName">
                        <el-input v-model="model.VendorName" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            
            <el-row>

                <el-col :span="8">
                    <el-form-item label="入货仓" prop="WarehouseName">
                        <el-input v-model="model.WarehouseName" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>


                <el-col :span="8">
                    <el-form-item label="入库日期" prop="DeliveryDate">
                        <el-input v-model="model.DeliveryDate" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="备注" prop="Remark">
                        <el-input v-model="model.Remark" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>


            </el-row>

            <el-row>

                <el-col :span="8">
                    <el-form-item label="付款方式" prop="PaymentCategory">
                        <el-input v-model="model.PaymentCategory" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="联系人" prop="VendorContact">
                        <el-input v-model="model.VendorContact" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="联系人电话" prop="VendorContactTel">
                        <el-input v-model="model.VendorContactTel" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            

            <el-row>
                <el-col :span="8">
                    <el-form-item label="付款账户" prop="PaymentAccount">
                        <el-input v-model="model.PaymentAccount" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="8">
                    <el-form-item label="付款日期" prop="PaymentTime">
                        <el-input v-model="model.PaymentTime" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="关联订单" prop="PaymentTime">
                        <el-input :value="(model.OrderPoId==null?'未关联':model.OrderPoId)" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>



            </el-row>

            <el-table :data="tableData" ref="dataForm" v-loading="isLoading" height="360">
                <el-table-column type="selection" width="55"></el-table-column>
                <el-table-column  prop="ItemCode" label="编号" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="ItemName" label="名称" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Spec" label="规格" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="UnitOfMeasure" label="单位" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Price" label="单价" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="CurrCount" label="当前库存" :show-overflow-tooltip="true"></el-table-column>

                <el-table-column prop="Count" label="数量" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Amount" label="金额" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="Remark" label="备注" :show-overflow-tooltip="true"></el-table-column>

            </el-table>

        </el-form>

    </div>

</template>

<script>

export default {
    props:{
        model:{
            require: true,
            type: Object,
        }
    },
    data(){
        return{
            //检测项目数据
            tableData: [],
        }
    },
    //实例生命周期
    created() {
        console.log(this.model);
        this.GetWhPoInboundItemById()
    },
    methods:{
        //采购入库IDId 返回产品数据
        GetWhPoInboundItemById(){
            this.isLoading=true;
            this.$http.get('/api/WhPoInbound/GetWhPoInboundItemById',{
                params:{
                    WhPoInboundId:this.model.Id,
                    WarehouseId:this.model.WarehouseId
                }
            })
            .then(res=>{
                this.isLoading=false;
                this.tableData = res.Data;
            })
        },
    }
}

</script>

<style>
</style>